define(function(require){
	
	var $=require("jq");
	//J_Select
	function SelectOption(obj){
		var _this_=this;
		//保存对象
		this.selectBox=obj;
		//保存输入区域
		this.inputArea=$("input",obj);
		//保存下拉列表框
		this.optionBox=$(".slide-down-con",obj);
		//保存下拉列表
		this.options=$(".slide-down-con i",obj);
		//事件初始化
		this.selectBox.click(function(e){
			e.stopPropagation();
			_this_.showOptionBox();
			$(document).click(function(e){_this_.hideOptionBox();});
		});
		this.options.click(function(e){
			e.stopPropagation();
			_this_.setValue(this);
		});
		this.inputArea.keydown(function(e){e.preventDefault();});
	};
	SelectOption.prototype={
		showOptionBox:function(){
			this.optionBox.slideDown("fast");
		},
		setValue:function(thisObj){
			this.inputArea.val($(thisObj).attr("data-value"));
			this.hideOptionBox();
		},
		hideOptionBox:function(){
			this.optionBox.slideUp("fast");
		}
	};
	var selectOption=new SelectOption($("#J_Select"));
});























